import { defineStore } from 'pinia'
import { computed, ref } from 'vue'

export const useCounterStore = defineStore('counter', () => {
  //定义 state
  const count = ref(100)
  //定义  getters
  const double = computed(() => count.value * 2)

  const addCount = () => {
    count.value++
  }
  return { count, double, addCount }
},{
  unistorage:true
})
